package com.assets.room.entity;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

import java.io.Serializable;
import java.util.Date;

@Entity(tableName = "sys_dept")
public class Dept implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @ColumnInfo(name = "dept_id")
    @PrimaryKey(autoGenerate = true)
    private Long deptId;

    /**
     * 父部门id
     */
    @ColumnInfo(name = "pid")
    private Long pid;

    /**
     * 父级ids
     */
    @ColumnInfo(name = "pids")
    private String pids;

    /**
     * 简称
     */
    @ColumnInfo(name = "simple_name")
    private String simpleName;

    /**
     * 全称
     */
    @ColumnInfo(name = "full_name")
    private String fullName;

    /**
     * 描述
     */
    @ColumnInfo(name = "description")
    private String description;

    /**
     * 版本（乐观锁保留字段）
     */
    @ColumnInfo(name = "version")
    private Integer version;

    /**
     * 排序
     */
    @ColumnInfo(name = "sort")
    private Integer sort;

    /**
     * 创建时间
     */
    @ColumnInfo(name = "create_time")
    private String createTime;

    /**
     * 修改时间
     */
    @ColumnInfo(name = "update_time")
    private String updateTime;

    /**
     * 创建人
     */
    @ColumnInfo(name = "create_user")
    private Long createUser;

    /**
     * 修改人
     */
    @ColumnInfo(name = "update_user")
    private Long updateUser;

    @ColumnInfo(name = "is_flag")
    private String isFlag;

    @Ignore
    public Dept() {
    }

    public Dept(Long deptId, Long pid, String pids,
                String simpleName, String fullName,
                String description, Integer version,
                Integer sort, String createTime,
                String updateTime, Long createUser,
                Long updateUser, String isFlag) {
        this.deptId = deptId;
        this.pid = pid;
        this.pids = pids;
        this.simpleName = simpleName;
        this.fullName = fullName;
        this.description = description;
        this.version = version;
        this.sort = sort;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.isFlag = isFlag;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public Long getPid() {
        return pid;
    }

    public void setPid(Long pid) {
        this.pid = pid;
    }

    public String getPids() {
        return pids;
    }

    public void setPids(String pids) {
        this.pids = pids;
    }

    public String getSimpleName() {
        return simpleName;
    }

    public void setSimpleName(String simpleName) {
        this.simpleName = simpleName;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public Long getCreateUser() {
        return createUser;
    }

    public void setCreateUser(Long createUser) {
        this.createUser = createUser;
    }

    public Long getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(Long updateUser) {
        this.updateUser = updateUser;
    }

    public String getIsFlag() {
        return isFlag;
    }

    public void setIsFlag(String isFlag) {
        this.isFlag = isFlag;
    }

    @Override
    public String toString() {
        return "Dept{" +
                "deptId=" + deptId +
                ", pid=" + pid +
                ", pids='" + pids + '\'' +
                ", simpleName='" + simpleName + '\'' +
                ", fullName='" + fullName + '\'' +
                ", description='" + description + '\'' +
                ", version=" + version +
                ", sort=" + sort +
                ", createTime='" + createTime + '\'' +
                ", updateTime='" + updateTime + '\'' +
                ", createUser=" + createUser +
                ", updateUser=" + updateUser +
                ", isFlag=" + isFlag +
                '}';
    }
}
